<ion-header>
  <ion-navbar>
    <ion-title left>物料（{{datas.length}}）</ion-title>
  </ion-navbar>
  <ng-container *ngIf="userInfo.SFZX!='0'">
    <ul class="wlzt">
      <li class="w04" (click)="push('WorkerMaterielStorePage','1')" > <!--[ngClass]="{'w04':!dev,'w06':dev}"-->
        <i class="fa fa-file-text-o"></i>
        <span>物料领用</span>
      </li>
      <li class="w04" (click)="push('WorkerMaterielReturnToPage','0')"  > <!--[ngClass]="{'w04':!dev,'w06':dev}"-->
        <i class="fa fa-file-o"></i>
        <span>物料退回</span>
      </li>
      <li class="w04" (click)="push('NewProductPage')"><!--pop($event,'NewProductPage')-->
        <i class="fa fa-files-o" ></i>
        <span>新品申请</span>
      </li>
    </ul>
  </ng-container>
</ion-header>

<ion-content (ionScroll)="scrollContent()">

  <ion-refresher (ionRefresh)="refresh($event)" pullMax="300"
                 [enabled]="userInfo.SFZX!='0'"
                 [ngClass]="{'t137':userInfo.SFZX!='0'}">
    <ion-refresher-content
      pullingText="下拉刷新"
      refreshingSpinner="circles"
      refreshingText="正在刷新...">
    </ion-refresher-content>
  </ion-refresher>

  <ng-container *ngIf="userInfo.SFZX!='0'">
      <ng-container *ngFor="let data of datas">
        <div class="w12 cart_pro bgcolor_white mt10">
          <div class="w12 cart_pro_header ">
            <div class="w12 qd_address">
              <em class="mr5" *ngIf="data.LLBJ==1">领料</em>
              <em class="mr5" *ngIf="data.LLBJ==0">退料</em>
              <span>订单号：{{data.ORDER_ID}}</span>
              <span *ngIf="data.DESCRIPTION!=null">转仓单号：{{data.DESCRIPTION}}</span>
              <span class="fr font_red">{{data.DJZT}}</span>
            </div>
          </div>
          <div class="w12 cart_pro_list  bb0 pb10">
            <ng-container *ngFor="let cost of data.materialCosts">
              <div class="w12 cart_pro_item mb0 pt10 pb0 pl10" style="padding-left:90px;">
                <img class="hide" src="">
                <h3 class="w12 pro_name" style="height:inherit;">{{cost.PRODUCT_NAME}}</h3>
                <div class="w12 mt10">
                  <div class="w06 pro_pic">
                    <span>￥</span>
                    <b class="fl">{{cost.PRICE | money}}</b>
                  </div>
                  <div class="w06 lh30 tr font_gray">
                    <span>数量:{{cost.QUANTITY}}{{cost.AMOUNT_UOM_ID}}</span>
                  </div>
                </div>
              </div>
            </ng-container>
          </div>
          <div class="w12 cart_pro_bottom">
            <span class="lh30">合计：<font class="font_red">{{ data.materialCosts.length }}</font>件商品，<font
              class="font_red">￥{{data.sum | money}}</font>元。</span>
            <button [disabled]="!data.canclick" (click)="sumbit(data)" *ngIf="data.LLBJ==1">确认收货</button>
          </div>
        </div>
      </ng-container>

      <div *ngIf="datasConfig.isEnd==true" class="w12 mt20 mb20 tc font_gray">
        ------------------------ 已经到底了 ------------------------
      </div>
      <ion-infinite-scroll (ionInfinite)="getMoreDatas($event)" threshold="100px" [enabled]="!datasConfig.isEnd">
        <ion-infinite-scroll-content loadingSpinner="bubbles" loadingText="数据加载中...">
        </ion-infinite-scroll-content>
      </ion-infinite-scroll>
  </ng-container>
  <div [ngStyle]="{'display': userInfo.SFZX == '0'? 'block':'none'}">
    <div style="text-align: center;width: 100%;height: 100%;padding-top: 50%;padding-bottom: 50%">
      <div padding text-center class="pt0">
        <span class="font_gray font_size_standard">未开工无法查看到任何信息哦！</span>
      </div>
      <div padding text-center>
        <button ion-fab (click)="switchIsWorking()" style="margin: 0 auto;width: 120px;height: 120px;font-size: 25px;">
          开工
        </button>
        <!--<i class="fa fa-lock font_gray" style="font-size: 80px;"></i>-->
      </div>
    </div>
  </div>
  <ion-fab bottom right *ngIf="!isScrollDown && userInfo.SFZX!='0'">
    <button ion-fab mini color="light" (click)="refresh()">
      <ion-icon name="md-refresh"></ion-icon>
    </button>
  </ion-fab>
</ion-content>
